# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=msttcorefonts-installer
pkgver=3.8
pkgrel=1
pkgdesc="Installer for Microsoft TrueType core fonts"
url="https://packages.debian.org/sid/ttf-mscorefonts-installer"
arch="noarch"
license="GPL-2.0-or-later"
depends="cabextract wget"
makedepends="$depends_dev"
install="$pkgname.post-install"
options="!check" #no test suite
source="http://ftp.debian.org/debian/pool/contrib/m/msttcorefonts/msttcorefonts_$pkgver.tar.xz
	remove-debian-stuff.patch
	"
builddir="$srcdir"/msttcorefonts

prepare() {
	default_prepare

	# default script has -Z selinux flag, not present
	# on busybox
	sed -i "s|mv -Z|mv|" "$builddir"/update-ms-fonts
}

package() {
	mkdir -p "$pkgdir"/usr/share/fonts/truetype/msttcorefonts
	install -m755 -D update-ms-fonts "$pkgdir"/usr/bin/update-ms-fonts
	install -m644 -D cabfiles.sha256sums \
		"$pkgdir"/var/lib/msttcorefonts/cabfiles.sha256sums
}

sha512sums="
6a2c57f39ba35aadc078493c70d13ea6d57d04922fd062a8a35453bce5e453bccf143a51a0383337aa520bc43a53e01ddc64bdba88a152f34b7df48c4723cfc6  msttcorefonts_3.8.tar.xz
3d1117b070beed9ac37eaf70f27ec4f3d9c894ad8622999ea772f9f7cb796e079723d86ff79fc2cdace0ff4c885dbc5c617ff8a144fc333277c27fd2a3f2f8e1  remove-debian-stuff.patch
"
